{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import cv2\n",
    "import numpy as np\n",
    "import os "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['COCO_train2014_000000000110.jpg', 'COCO_train2014_000000000109.jpg', 'COCO_train2014_000000000094.jpg'] ['COCO_train2014_000000000110.txt', 'COCO_train2014_000000000109.txt', 'COCO_train2014_000000000094.txt']\n",
      "COCO_train2014_000000000110.jpg\n",
      "[[[ 24  25  23]\n",
      "  [ 35  33  33]\n",
      "  [ 27  23  28]\n",
      "  ...\n",
      "  [ 46  44  74]\n",
      "  [ 40  39  73]\n",
      "  [ 26  22  63]]\n",
      "\n",
      " [[ 24  23  19]\n",
      "  [ 33  31  31]\n",
      "  [ 29  25  30]\n",
      "  ...\n",
      "  [ 48  45  77]\n",
      "  [ 46  46  76]\n",
      "  [ 29  30  58]]\n",
      "\n",
      " [[ 28  25  20]\n",
      "  [ 27  23  22]\n",
      "  [ 29  24  25]\n",
      "  ...\n",
      "  [ 49  45  80]\n",
      "  [ 55  53  89]\n",
      "  [ 32  31  70]]\n",
      "\n",
      " ...\n",
      "\n",
      " [[219 224 215]\n",
      "  [217 225 215]\n",
      "  [221 229 218]\n",
      "  ...\n",
      "  [ 88  98  98]\n",
      "  [ 83 103 104]\n",
      "  [ 70 100 101]]\n",
      "\n",
      " [[221 223 217]\n",
      "  [222 227 218]\n",
      "  [219 227 217]\n",
      "  ...\n",
      "  [ 88 104 103]\n",
      "  [ 90 102 102]\n",
      "  [ 93  98  99]]\n",
      "\n",
      " [[217 219 213]\n",
      "  [213 216 207]\n",
      "  [215 221 210]\n",
      "  ...\n",
      "  [ 90 103 105]\n",
      "  [ 88 104 103]\n",
      "  [ 86 105 102]]]\n",
      "(480, 640, 3)\n"
     ]
    }
   ],
   "source": [
    "coco_img_path = 'coco/images/'\n",
    "coco_label_path = 'coco/labels/'\n",
    "coco_images = os.listdir(coco_img_path)\n",
    "coco_labels = os.listdir(coco_label_path)\n",
    "print(coco_images,coco_labels)\n",
    "print(coco_images[0])\n",
    "coco_img_totest_path = coco_img_path + coco_images[0]\n",
    "print(coco_img_totest)\n",
    "# f = open('train.txt','w')\n",
    "# for img in coco_images:\n",
    "#     f.write(coco_img_path+img+'\\n')\n",
    "# f.close()\n",
    "coco_img_totest = cv2.imread(coco_img_totest_path)\n",
    "\n",
    "print(coco_img_totest.shape)\n",
    "cv2.imshow('t',coco_img_totest)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
